<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AddColumnCruiseOrderIdToCruiseCheckAlbum extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('cruise_check_album', function (Blueprint $table) {
            $table->unsignedInteger('cruiseOrderId')->after('relationId')->default(0)->comment('关联的任务ID');

            $table->index('cruiseOrderId', 'idx_cruiseOrderId');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('cruise_check_album', function (Blueprint $table) {
            $table->dropColumn('cruiseOrderId');
        });
    }
}
